package com.rain.rainspringboot3.order.strategy.impl;// NormalOrderSaveStrategy.java

import com.rain.rainspringboot3.order.entity.Order;
import com.rain.rainspringboot3.order.enums.OrderTypeEnum;
import com.rain.rainspringboot3.order.strategy.AbstractOrderSaveTemplate;
import org.springframework.stereotype.Component;

@Component
public class ArticleServiceOrderSaveStrategy extends AbstractOrderSaveTemplate {
    @Override
    public boolean supports(OrderTypeEnum type) {
        return OrderTypeEnum.ARTICLE_SERVICE.equals(type);
    }

    @Override
    protected void doSave(Order order) {
        // 模拟保存到 DB
        System.out.println("保存稿件服务订单: " + order.getCustomerName());

    }

    @Override
    protected void preProcess(Order order) {
        System.out.println("【稿件服务】预处理");
    }

    @Override
    protected void postProcess(Order order) {
        System.out.println("【稿件服务】后处理");
    }
}